home *** CD-ROM | disk | FTP | other *** search
- /******************************************************************************
- ExampleDemo.c
-
- This showcase application shows CDragAcrossTable and CDragAcrossTask. These
- classes together provide the user feedback and programmer hooks to
- implement drag and drop BETWEEN cells. To see how this works get the latest
- showcase application from ftp.brown.edu in the /pub/tcl/examples directory
- and add following files to a new segment
-
- CDragAcrossTable.c
-
- CDragAcrossTask.c
- CGlobalMouseTask.c
-
- ExampleDemo.c
- ExampleDemo.rsrc
-
- ForgetRgn.c
-
- Compile and run. Now create two CDragAcrossTable demo windows, select some
- cells in one and then Control-click-and-hold to drag the selection around and
- between the windows. Hold the mouse close to the edge and the windows scroll.
- When you release the mouse nothing happens...its just a demo of the class.
-
- If you have any questions or comments, please send email.
-
- AUTHOR: Andrew_Gilmartin@Brown.Edu
- MODIFIED: 93-11-04
-
- Copyright (C) 1993 by Brown University. All rights reserved.
-
- Permission is granted to any individual or institution to use, copy,
- or redistribute the binary version of this software and its
- documentation provided this notice and the copyright notices are
- retained. Permission is granted to any individual or non-profit
- institution to use, copy, modify, or redistribute the source files
- of this software provided this notice and the copyright notices are
- retained. This software may not be distributed for profit, either
- in original form or in derivative works, nor can the source be
- distributed to other than an individual or a non-profit institution.
- Any individual or group interested in seeing and/or using these
- source files but who are prevented from doing so by the above
- constraints should contact Don Wolfe, Vice-President for Computer
- Systems at Brown University, (401) 863-7247, for possible
- software licensing of the source developed at Brown.
-
- Brown University and Andrew James Gilmartin make no representations
- about the suitability of this software for any purpose.
-
- BROWN UNIVERSITY AND ANDREW JAMES GILMARTIN GIVE NO WARRANTY, EITHER
- EXPRESS OR IMPLIED, FOR THE PROGRAM AND/OR DOCUMENTATION PROVIDED,
- INCLUDING, WITHOUT LIMITATION, WARRANTY OF MERCHANTABILITY AND
- WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE.
-
- ******************************************************************************/
-
- #include <CDecorator.h>
- #include "CSApplication.h"
- #include "CDragAcrossTable.h"
- #include "ExampleDemo.h"
-
-
- extern CDecorator *gDecorator;
-
-
-
- /******************************************************************************
- INewDemo
-
- Build and place a window containing a CDragAcrossTable.
- ******************************************************************************/
-
- void CDragAcrossTableDemoDir::INewDemo( CDirectorOwner *aSupervisor )
- {
- CScrollPane* theScrollPane = NULL;
- CDragAcrossTable* theTable = NULL;
- int i;
-
- inherited::INewDemo( aSupervisor );
-
- itsWindow = new CWindow;
- itsWindow->IWindow( 4560, FALSE, gDesktop, this );
-
- theScrollPane = new CScrollPane;
- theScrollPane->IScrollPane
- ( itsWindow, this
- , 0, 0
- , 0, 0
- , sizELASTIC, sizELASTIC
- , TRUE, TRUE, TRUE );
- theScrollPane->FitToEnclFrame( TRUE, TRUE );
-
- theTable = new CDragAcrossTable;
- theTable->IDragAcrossTable
- ( theScrollPane, this
- , 0, 0
- , 0, 0
- , sizELASTIC
- , sizELASTIC );
- theTable->FitToEnclosure( TRUE, TRUE );
- theScrollPane->InstallPanorama( theTable );
-
- theTable->AddRow( 25, -1 );
- theTable->AddCol( 25, -1 );
-
- gDecorator->StaggerWindow( itsWindow );
- itsWindow->Select();
-
- } /* CDragAcrossTableDemoDir */